package com.example.application2;

import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;


public class Activity1 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_1);
        final Button button6 = (Button) findViewById(R.id.button6);
        button6.setOnClickListener(new View.OnClickListener(){
            final LinearLayout root_layout=(LinearLayout)findViewById(R.id.root_layout);
            @Override
            public void onClick(View v){
                root_layout.setGravity(0);
            }
        });
        final Button button8 = (Button) findViewById(R.id.button8);
        button8.setOnClickListener(new View.OnClickListener(){
            final LinearLayout root_layout=(LinearLayout)findViewById(R.id.root_layout);
            @Override
            public void onClick(View v){
                root_layout.setOrientation(LinearLayout.VERTICAL);
            }
        });
        final Button button7 = (Button) findViewById(R.id.button7);
        button7.setOnClickListener(new View.OnClickListener(){
            LinearLayout root_layout=(LinearLayout)findViewById(R.id.root_layout);
            @Override
            public void onClick(View v){
                root_layout.setOrientation(LinearLayout.HORIZONTAL);
            }
        });
        Button button17 = (Button) findViewById(R.id.button17);
        button17.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent i=new Intent(Activity1.this,MainActivity.class);
                startActivity(i);
            }
        });
    }
}
